/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * PresentFlows.java
 *
 * Created on Jan 14, 2012, 1:45:29 AM
 */
package routing.Presentation;
import java.util.List;
import routing.Structs.FlowStruct.Flow;
/**
 *
 * @author barbarosa
 */
public class PresentFlows extends javax.swing.JPanel {
    private String OutputString="";
    /** Creates new form PresentFlows */
    public PresentFlows(List<Flow> Flows) {
        initComponents();
        PrintFlows(Flows);
    }
    
    
    
    private void PrintFlows(List<Flow> Flows){
    for(Flow fl:Flows){
        //this.jEditorPane1.setText(this.jEditorPane1.getText()+"<p>");
        appendString("H Flow \""+fl.GetFlowName()+"\" periexei tous komvous ");
        for(Integer i:fl.GetAddedNodesList()){
            appendString(i.toString()+",");
        }
        appendString(" kai to NodeDelay einai <b>"+fl.GetND()+"</b>");
        appendString("<br/>");
    }
        PrintString();
    }
    private void appendString(String str){
        OutputString=OutputString+str;
    }
    
    private void PrintString(){
        this.jEditorPane1.setEditable(false);
        this.jEditorPane1.setContentType("text/html");
        this.jEditorPane1.setText(OutputString);
    }
    
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        jEditorPane1 = new javax.swing.JEditorPane();

        jScrollPane1.setViewportView(jEditorPane1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 421, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(28, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 322, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(26, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JEditorPane jEditorPane1;
    private javax.swing.JScrollPane jScrollPane1;
    // End of variables declaration//GEN-END:variables
}
